<template>
  <div class="flex-center">
    <template v-if="showExpedited">
      <el-tooltip v-if="!!isExpedited" placement="top" effect="dark">
        <div slot="content">{{ isExpedited === 1 ? '加急中' : '已取消加急' }}</div>
        <el-image :src="isExpedited === 1 ? pressImg : pressCancel" class="img"/>
      </el-tooltip>
      <div v-else class="img"/>
    </template>
    <slot/>
  </div>
</template>
<script>
import pressImg from '@/assets/press_icon.png';
import pressCancel from '@/assets/cancel-press.png';
export default {
  props: {
    showExpedited: {
      type: Number | Boolean,
      default: true
    },
    isExpedited: {
      type: Number | Boolean,
      default: 0
    }
  },
  data() {
    return {
      pressImg,
      pressCancel
    };
  }
};
</script>
<style lang="scss" scoped>
.img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-right: 2px;
}
</style>
